<template>
  <div class="app-container">
    <el-row :gutter="20">
      <el-col :span="4" :xs="24">
        <div class="head-container">
          <el-input
            v-model="filterText"
            placeholder="请输入城市名称"
            clearable
            size="small"
            prefix-icon="el-icon-search"
            style="margin-bottom: 20px"
          />
        </div>
        <div class="head-container">
          <el-tree
            class="filter-tree"
            :data="cityOptions"
            :props="defaultCityProps"
            :expand-on-click-node="true"
            :filter-node-method="filterNode"
            ref="tree"
            :default-expand-all="false"
            @node-click="handleNodeClick"
          />
        </div>
      </el-col>


      <el-col :span="20" :xs="24">

        <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
          <el-form-item label="code" prop="code">
            <el-input
              v-model="queryParams.code"
              placeholder="请输入code"
              clearable
              size="small"
              @keyup.enter.native="handleQuery"
            />
          </el-form-item>
          <el-form-item label="父级编码" prop="parentCode">
            <el-input
              v-model="queryParams.parentCode"
              placeholder="请输入父级编码"
              clearable
              size="small"
              @keyup.enter.native="handleQuery"
            />
          </el-form-item>
          <el-form-item label="城市名称" prop="name">
            <el-input
              v-model="queryParams.name"
              placeholder="请输入城市名称"
              clearable
              size="small"
              @keyup.enter.native="handleQuery"
            />
          </el-form-item>
          <el-form-item label="拼音首字" prop="firstLetter">
            <el-input
              v-model="queryParams.firstLetter"
              placeholder="请输入拼音首字母"
              clearable
              size="small"
              @keyup.enter.native="handleQuery"
            />
          </el-form-item>
          <el-form-item label="拼音检索" prop="pinyin">
            <el-input
              v-model="queryParams.pinyin"
              placeholder="请输入城市名称的完整汉语拼音，用于拼音检索"
              clearable
              size="small"
              @keyup.enter.native="handleQuery"
            />
          </el-form-item>
          <el-form-item label="邮政编码" prop="zipCode">
            <el-input
              v-model="queryParams.zipCode"
              placeholder="请输入邮政编码"
              clearable
              size="small"
              @keyup.enter.native="handleQuery"
            />
          </el-form-item>
          <el-form-item>
            <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
            <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
          </el-form-item>
        </el-form>

        <el-row :gutter="10" class="mb8">
          <el-col :span="1.5">
            <el-button
              type="primary"
              plain
              icon="el-icon-plus"
              size="mini"
              @click="handleAdd"
              v-hasPermi="['manager:city:add']"
            >新增
            </el-button>
          </el-col>
          <el-col :span="1.5">
            <el-button
              type="success"
              plain
              icon="el-icon-edit"
              size="mini"
              :disabled="single"
              @click="handleUpdate"
              v-hasPermi="['manager:city:edit']"
            >修改
            </el-button>
          </el-col>
          <el-col :span="1.5">
            <el-button
              type="danger"
              plain
              icon="el-icon-delete"
              size="mini"
              :disabled="multiple"
              @click="handleDelete"
              v-hasPermi="['manager:city:remove']"
            >删除
            </el-button>
          </el-col>
          <el-col :span="1.5">
            <el-button
              type="warning"
              plain
              icon="el-icon-download"
              size="mini"
              @click="handleExport"
              v-hasPermi="['manager:city:export']"
            >导出
            </el-button>
          </el-col>
          <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
        </el-row>

        <el-table v-loading="loading" :data="cityList" @selection-change="handleSelectionChange">
          <el-table-column type="selection" width="55" align="center"/>
          <el-table-column label="code" align="center" prop="code"/>
          <el-table-column label="父级编码" align="center" prop="parentCode"/>
          <el-table-column label="城市名称" align="center" prop="name"/>
          <el-table-column label="城市类型" align="center" prop="type"/>
          <el-table-column label="拼音首字母" align="center" prop="firstLetter"/>
          <el-table-column label="拼音检索" align="center" prop="pinyin"/>
          <el-table-column label="邮政编码" align="center" prop="zipCode"/>
          <el-table-column label="状态" align="center" prop="status"/>
          <el-table-column label="备注" align="center" prop="remark"/>
          <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
            <template slot-scope="scope">
              <el-button
                size="mini"
                type="text"
                icon="el-icon-edit"
                @click="handleUpdate(scope.row)"
                v-hasPermi="['manager:city:edit']"
              >修改
              </el-button>
              <el-button
                size="mini"
                type="text"
                icon="el-icon-delete"
                @click="handleDelete(scope.row)"
                v-hasPermi="['manager:city:remove']"
              >删除
              </el-button>
            </template>
          </el-table-column>
        </el-table>

        <pagination
          v-show="total>0"
          :total="total"
          :page.sync="queryParams.pageNum"
          :limit.sync="queryParams.pageSize"
          @pagination="getList"
        />
      </el-col>
    </el-row>
    <!-- 添加或修改城市数据对话框 -->
    <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
        <el-form-item label="code" prop="code">
          <el-input v-model="form.code" placeholder="请输入code"/>
        </el-form-item>
        <el-form-item label="父级编码" prop="parentCode">
          <el-input v-model="form.parentCode" placeholder="请输入父级编码"/>
        </el-form-item>
        <el-form-item label="城市名称" prop="name">
          <el-input v-model="form.name" placeholder="请输入城市名称"/>
        </el-form-item>
        <el-form-item label="拼音首字母" prop="firstLetter">
          <el-input v-model="form.firstLetter" placeholder="请输入拼音首字母"/>
        </el-form-item>
        <el-form-item label="城市名称的完整汉语拼音，用于拼音检索" prop="pinyin">
          <el-input v-model="form.pinyin" placeholder="请输入城市名称的完整汉语拼音，用于拼音检索"/>
        </el-form-item>
        <el-form-item label="邮政编码" prop="zipCode">
          <el-input v-model="form.zipCode" placeholder="请输入邮政编码"/>
        </el-form-item>
        <el-form-item label="删除标志" prop="delFlag">
          <el-input v-model="form.delFlag" placeholder="请输入删除标志"/>
        </el-form-item>
        <el-form-item label="备注" prop="remark">
          <el-input v-model="form.remark" type="textarea" placeholder="请输入内容"/>
        </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="submitForm">确 定</el-button>
        <el-button @click="cancel">取 消</el-button>
      </div>
    </el-dialog>
  </div>
</template>

<script>
import {listCity, getCity, delCity, addCity, updateCity} from "@/api/manager/city";
import { cityTree } from "@/api/manager/city";
import Treeselect from "@riophae/vue-treeselect";
import "@riophae/vue-treeselect/dist/vue-treeselect.css";

export default {
  name: "City",
  dicts: ['sys_normal_disable', 'sys_user_sex'],
  components: { Treeselect },
  data() {
    return {
      filterText: '',
      // 遮罩层
      loading: true,
      // 选中数组
      ids: [],
      // 非单个禁用
      single: true,
      // 非多个禁用
      multiple: true,
      // 显示搜索条件
      showSearch: true,
      // 总条数
      total: 0,
      defaultCityProps: {
        children: 'children',
        label: 'label'
      },
      // 城市数据表格数据
      cityOptions: [{
        "id": 130000,
        "label": "河北省",
        "children": [{
          "id": 130100,
          "label": "石家庄市",
          "children": [{
            "id": 130128,
            "label": "深泽县"
          },
            {
              "id": 130105,
              "label": "新华区"
            },
            {
              "id": 130129,
              "label": "赞皇县"
            },
            {
              "id": 130131,
              "label": "平山县"
            },
            {
              "id": 130107,
              "label": "井陉矿区"
            },
            {
              "id": 130110,
              "label": "鹿泉区"
            },
            {
              "id": 130183,
              "label": "晋州市"
            },
            {
              "id": 130111,
              "label": "栾城区"
            },
            {
              "id": 130121,
              "label": "井陉县"
            },
            {
              "id": 130181,
              "label": "辛集市"
            },
            {
              "id": 130130,
              "label": "无极县"
            },
            {
              "id": 130127,
              "label": "高邑县"
            },
            {
              "id": 130108,
              "label": "裕华区"
            },
            {
              "id": 130125,
              "label": "行唐县"
            },
            {
              "id": 130104,
              "label": "桥西区"
            },
            {
              "id": 130184,
              "label": "新乐市"
            },
            {
              "id": 130102,
              "label": "长安区"
            },
            {
              "id": 130109,
              "label": "藁城区"
            },
            {
              "id": 130126,
              "label": "灵寿县"
            },
            {
              "id": 130123,
              "label": "正定县"
            },
            {
              "id": 130132,
              "label": "元氏县"
            },
            {
              "id": 130133,
              "label": "赵县"
            }
          ]
        },
          {
            "id": 130200,
            "label": "唐山市",
            "children": [{
              "id": 130202,
              "label": "路南区"
            },
              {
                "id": 130204,
                "label": "古冶区"
              },
              {
                "id": 130203,
                "label": "路北区"
              },
              {
                "id": 130209,
                "label": "曹妃甸区"
              },
              {
                "id": 130281,
                "label": "遵化市"
              },
              {
                "id": 130223,
                "label": "滦县"
              },
              {
                "id": 130207,
                "label": "丰南区"
              },
              {
                "id": 130208,
                "label": "丰润区"
              },
              {
                "id": 130224,
                "label": "滦南县"
              },
              {
                "id": 130225,
                "label": "乐亭县"
              },
              {
                "id": 130229,
                "label": "玉田县"
              },
              {
                "id": 130205,
                "label": "开平区"
              },
              {
                "id": 130227,
                "label": "迁西县"
              },
              {
                "id": 130283,
                "label": "迁安市"
              }
            ]
          },
          {
            "id": 130400,
            "label": "邯郸市",
            "children": [{
              "id": 130435,
              "label": "曲周县"
            },
              {
                "id": 130402,
                "label": "邯山区"
              },
              {
                "id": 130426,
                "label": "涉县"
              },
              {
                "id": 130433,
                "label": "馆陶县"
              },
              {
                "id": 130430,
                "label": "邱县"
              },
              {
                "id": 130403,
                "label": "丛台区"
              },
              {
                "id": 130424,
                "label": "成安县"
              },
              {
                "id": 130481,
                "label": "武安市"
              },
              {
                "id": 130427,
                "label": "磁县"
              },
              {
                "id": 130432,
                "label": "广平县"
              },
              {
                "id": 130434,
                "label": "魏县"
              },
              {
                "id": 130404,
                "label": "复兴区"
              },
              {
                "id": 130423,
                "label": "临漳县"
              },
              {
                "id": 130408,
                "label": "永年区"
              },
              {
                "id": 130425,
                "label": "大名县"
              },
              {
                "id": 130431,
                "label": "鸡泽县"
              },
              {
                "id": 130406,
                "label": "峰峰矿区"
              },
              {
                "id": 130407,
                "label": "肥乡区"
              }
            ]
          },
          {
            "id": 131000,
            "label": "廊坊市",
            "children": [{
              "id": 131003,
              "label": "广阳区"
            },
              {
                "id": 131023,
                "label": "永清县"
              },
              {
                "id": 131024,
                "label": "香河县"
              },
              {
                "id": 131082,
                "label": "三河市"
              },
              {
                "id": 131022,
                "label": "固安县"
              },
              {
                "id": 131026,
                "label": "文安县"
              },
              {
                "id": 131025,
                "label": "大城县"
              },
              {
                "id": 131028,
                "label": "大厂回族自治县"
              },
              {
                "id": 131081,
                "label": "霸州市"
              },
              {
                "id": 131002,
                "label": "安次区"
              }
            ]
          },
          {
            "id": 131100,
            "label": "衡水市",
            "children": [{
              "id": 131126,
              "label": "故城县"
            },
              {
                "id": 131123,
                "label": "武强县"
              },
              {
                "id": 131127,
                "label": "景县"
              },
              {
                "id": 131103,
                "label": "冀州区"
              },
              {
                "id": 131125,
                "label": "安平县"
              },
              {
                "id": 131182,
                "label": "深州市"
              },
              {
                "id": 131128,
                "label": "阜城县"
              },
              {
                "id": 131121,
                "label": "枣强县"
              },
              {
                "id": 131102,
                "label": "桃城区"
              },
              {
                "id": 131122,
                "label": "武邑县"
              },
              {
                "id": 131124,
                "label": "饶阳县"
              }
            ]
          },
          {
            "id": 130800,
            "label": "承德市",
            "children": [{
              "id": 130803,
              "label": "双滦区"
            },
              {
                "id": 130802,
                "label": "双桥区"
              },
              {
                "id": 130821,
                "label": "承德县"
              },
              {
                "id": 130827,
                "label": "宽城满族自治县"
              },
              {
                "id": 130826,
                "label": "丰宁满族自治县"
              },
              {
                "id": 130881,
                "label": "平泉市"
              },
              {
                "id": 130825,
                "label": "隆化县"
              },
              {
                "id": 130824,
                "label": "滦平县"
              },
              {
                "id": 130804,
                "label": "鹰手营子矿区"
              },
              {
                "id": 130822,
                "label": "兴隆县"
              },
              {
                "id": 130828,
                "label": "围场满族蒙古族自治县"
              }
            ]
          },
          {
            "id": 130600,
            "label": "保定市",
            "children": [{
              "id": 130631,
              "label": "望都县"
            },
              {
                "id": 130606,
                "label": "莲池区"
              },
              {
                "id": 130624,
                "label": "阜平县"
              },
              {
                "id": 130623,
                "label": "涞水县"
              },
              {
                "id": 130626,
                "label": "定兴县"
              },
              {
                "id": 130629,
                "label": "容城县"
              },
              {
                "id": 130630,
                "label": "涞源县"
              },
              {
                "id": 130633,
                "label": "易县"
              },
              {
                "id": 130602,
                "label": "竞秀区"
              },
              {
                "id": 130681,
                "label": "涿州市"
              },
              {
                "id": 130634,
                "label": "曲阳县"
              },
              {
                "id": 130682,
                "label": "定州市"
              },
              {
                "id": 130628,
                "label": "高阳县"
              },
              {
                "id": 130683,
                "label": "安国市"
              },
              {
                "id": 130609,
                "label": "徐水区"
              },
              {
                "id": 130627,
                "label": "唐县"
              },
              {
                "id": 130637,
                "label": "博野县"
              },
              {
                "id": 130638,
                "label": "雄县"
              },
              {
                "id": 130608,
                "label": "清苑区"
              },
              {
                "id": 130635,
                "label": "蠡县"
              },
              {
                "id": 130636,
                "label": "顺平县"
              },
              {
                "id": 130607,
                "label": "满城区"
              },
              {
                "id": 130684,
                "label": "高碑店市"
              },
              {
                "id": 130632,
                "label": "安新县"
              }
            ]
          },
          {
            "id": 130700,
            "label": "张家口市",
            "children": [{
              "id": 130723,
              "label": "康保县"
            },
              {
                "id": 130726,
                "label": "蔚县"
              },
              {
                "id": 130702,
                "label": "桥东区"
              },
              {
                "id": 130725,
                "label": "尚义县"
              },
              {
                "id": 130703,
                "label": "桥西区"
              },
              {
                "id": 130722,
                "label": "张北县"
              },
              {
                "id": 130731,
                "label": "涿鹿县"
              },
              {
                "id": 130730,
                "label": "怀来县"
              },
              {
                "id": 130706,
                "label": "下花园区"
              },
              {
                "id": 130724,
                "label": "沽源县"
              },
              {
                "id": 130708,
                "label": "万全区"
              },
              {
                "id": 130727,
                "label": "阳原县"
              },
              {
                "id": 130728,
                "label": "怀安县"
              },
              {
                "id": 130705,
                "label": "宣化区"
              },
              {
                "id": 130709,
                "label": "崇礼区"
              },
              {
                "id": 130732,
                "label": "赤城县"
              }
            ]
          },
          {
            "id": 130300,
            "label": "秦皇岛市",
            "children": [{
              "id": 130321,
              "label": "青龙满族自治县"
            },
              {
                "id": 130306,
                "label": "抚宁区"
              },
              {
                "id": 130303,
                "label": "山海关区"
              },
              {
                "id": 130302,
                "label": "海港区"
              },
              {
                "id": 130322,
                "label": "昌黎县"
              },
              {
                "id": 130304,
                "label": "北戴河区"
              },
              {
                "id": 130324,
                "label": "卢龙县"
              }
            ]
          },
          {
            "id": 130500,
            "label": "邢台市",
            "children": [{
              "id": 130503,
              "label": "桥西区"
            },
              {
                "id": 130526,
                "label": "任县"
              },
              {
                "id": 130524,
                "label": "柏乡县"
              },
              {
                "id": 130528,
                "label": "宁晋县"
              },
              {
                "id": 130529,
                "label": "巨鹿县"
              },
              {
                "id": 130502,
                "label": "桥东区"
              },
              {
                "id": 130521,
                "label": "邢台县"
              },
              {
                "id": 130525,
                "label": "隆尧县"
              },
              {
                "id": 130523,
                "label": "内丘县"
              },
              {
                "id": 130582,
                "label": "沙河市"
              },
              {
                "id": 130581,
                "label": "南宫市"
              },
              {
                "id": 130522,
                "label": "临城县"
              },
              {
                "id": 130530,
                "label": "新河县"
              },
              {
                "id": 130535,
                "label": "临西县"
              },
              {
                "id": 130527,
                "label": "南和县"
              },
              {
                "id": 130532,
                "label": "平乡县"
              },
              {
                "id": 130534,
                "label": "清河县"
              },
              {
                "id": 130531,
                "label": "广宗县"
              },
              {
                "id": 130533,
                "label": "威县"
              }
            ]
          },
          {
            "id": 130900,
            "label": "沧州市",
            "children": [{
              "id": 130921,
              "label": "沧县"
            },
              {
                "id": 130982,
                "label": "任丘市"
              },
              {
                "id": 130929,
                "label": "献县"
              },
              {
                "id": 130983,
                "label": "黄骅市"
              },
              {
                "id": 130925,
                "label": "盐山县"
              },
              {
                "id": 130928,
                "label": "吴桥县"
              },
              {
                "id": 130930,
                "label": "孟村回族自治县"
              },
              {
                "id": 130984,
                "label": "河间市"
              },
              {
                "id": 130924,
                "label": "海兴县"
              },
              {
                "id": 130922,
                "label": "青县"
              },
              {
                "id": 130981,
                "label": "泊头市"
              },
              {
                "id": 130926,
                "label": "肃宁县"
              },
              {
                "id": 130923,
                "label": "东光县"
              },
              {
                "id": 130927,
                "label": "南皮县"
              },
              {
                "id": 130903,
                "label": "运河区"
              },
              {
                "id": 130902,
                "label": "新华区"
              }
            ]
          }
        ]
      },
        {
          "id": 110000,
          "label": "北京市",
          "children": [{
            "id": 110100,
            "label": "北京市",
            "children": [{
              "id": 110114,
              "label": "昌平区"
            },
              {
                "id": 110105,
                "label": "朝阳区"
              },
              {
                "id": 110102,
                "label": "西城区"
              },
              {
                "id": 110109,
                "label": "门头沟区"
              },
              {
                "id": 110113,
                "label": "顺义区"
              },
              {
                "id": 110117,
                "label": "平谷区"
              },
              {
                "id": 110111,
                "label": "房山区"
              },
              {
                "id": 110101,
                "label": "东城区"
              },
              {
                "id": 110108,
                "label": "海淀区"
              },
              {
                "id": 110107,
                "label": "石景山区"
              },
              {
                "id": 110112,
                "label": "通州区"
              },
              {
                "id": 110115,
                "label": "大兴区"
              },
              {
                "id": 110118,
                "label": "密云区"
              },
              {
                "id": 110119,
                "label": "延庆区"
              },
              {
                "id": 110116,
                "label": "怀柔区"
              },
              {
                "id": 110106,
                "label": "丰台区"
              }
            ]
          }]
        },
        {
          "id": 120000,
          "label": "天津市",
          "children": [{
            "id": 120100,
            "label": "天津市",
            "children": [{
              "id": 120111,
              "label": "西青区"
            },
              {
                "id": 120118,
                "label": "静海区"
              },
              {
                "id": 120113,
                "label": "北辰区"
              },
              {
                "id": 120119,
                "label": "蓟州区"
              },
              {
                "id": 120102,
                "label": "河东区"
              },
              {
                "id": 120110,
                "label": "东丽区"
              },
              {
                "id": 120117,
                "label": "宁河区"
              },
              {
                "id": 120112,
                "label": "津南区"
              },
              {
                "id": 120116,
                "label": "滨海新区"
              },
              {
                "id": 120101,
                "label": "和平区"
              },
              {
                "id": 120104,
                "label": "南开区"
              },
              {
                "id": 120103,
                "label": "河西区"
              },
              {
                "id": 120105,
                "label": "河北区"
              },
              {
                "id": 120106,
                "label": "红桥区"
              },
              {
                "id": 120115,
                "label": "宝坻区"
              },
              {
                "id": 120114,
                "label": "武清区"
              }
            ]
          }]
        }
      ],
      cityList: [],
      // 弹出层标题
      title: "",
      // 是否显示弹出层
      open: false,
      // 查询参数
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        code: null,
        parentCode: null,
        name: null,
        type: null,
        firstLetter: null,
        pinyin: null,
        zipCode: null,
        status: null,
      },
      // 表单参数
      form: {},
      // 表单校验
      rules: {}
    };
  },
  watch: {
    filterText(val) {
      this.$refs.tree.filter(val);
    }
  },
  created() {
    this.getCityTree();
    this.getList();
  },
  methods: {
    getCityTree() {
      cityTree().then(response => {
        this.cityOptions = response.data;
      });
    },
    // 筛选节点
    filterNode(value, data) {
      if (!value) return true;
      return data.label.indexOf(value) !== -1;
    },
    handleNodeClick(data) {
      console.log(data);
      this.queryParams.code = data.id;
      this.handleQuery();
      this.getCheckedNodes();
    },
    getCheckedNodes() {
      console.log(this.$refs.tree.getCheckedNodes());
    },
    /** 查询城市数据列表 */
    getList() {
      this.loading = true;
      listCity(this.queryParams).then(response => {
        this.cityList = response.rows;
        this.total = response.total;
        this.loading = false;
      });
    },
    // 取消按钮
    cancel() {
      this.open = false;
      this.reset();
    },
    // 表单重置
    reset() {
      this.form = {
        id: null,
        code: null,
        parentCode: null,
        name: null,
        type: null,
        firstLetter: null,
        pinyin: null,
        zipCode: null,
        status: "0",
        delFlag: null,
        createBy: null,
        createTime: null,
        updateBy: null,
        updateTime: null,
        remark: null
      };
      this.resetForm("form");
    },
    /** 搜索按钮操作 */
    handleQuery() {
      this.queryParams.pageNum = 1;
      this.getList();
    },
    /** 重置按钮操作 */
    resetQuery() {
      this.resetForm("queryForm");
      this.handleQuery();
    },
    // 多选框选中数据
    handleSelectionChange(selection) {
      this.ids = selection.map(item => item.id)
      this.single = selection.length !== 1
      this.multiple = !selection.length
    },
    /** 新增按钮操作 */
    handleAdd() {
      this.reset();
      this.open = true;
      this.title = "添加城市数据";
    },
    /** 修改按钮操作 */
    handleUpdate(row) {
      this.reset();
      const id = row.id || this.ids
      getCity(id).then(response => {
        this.form = response.data;
        this.open = true;
        this.title = "修改城市数据";
      });
    },
    /** 提交按钮 */
    submitForm() {
      this.$refs["form"].validate(valid => {
        if (valid) {
          if (this.form.id != null) {
            updateCity(this.form).then(response => {
              this.$modal.msgSuccess("修改成功");
              this.open = false;
              this.getList();
            });
          } else {
            addCity(this.form).then(response => {
              this.$modal.msgSuccess("新增成功");
              this.open = false;
              this.getList();
            });
          }
        }
      });
    },
    /** 删除按钮操作 */
    handleDelete(row) {
      const ids = row.id || this.ids;
      this.$modal.confirm('是否确认删除城市数据编号为"' + ids + '"的数据项？').then(function () {
        return delCity(ids);
      }).then(() => {
        this.getList();
        this.$modal.msgSuccess("删除成功");
      }).catch(() => {
      });
    },
    /** 导出按钮操作 */
    handleExport() {
      this.download('manager/city/export', {
        ...this.queryParams
      }, `city_${new Date().getTime()}.xlsx`)
    }
  }
};
</script>
<style>
.el-tree {
  height: 600px;
  overflow:auto;
}
</style>
